package cn.fsd.controller;

import cn.fsd.feignclients.SubStationFeignClient;
import cn.fsd.query.substation.WorkloadBean;
import cn.fsd.query.substation.WorkloadQuery;
import cn.fsd.service.impl.BusinessServiceImpl;
import cn.fsd.vo.PageBean;
import cn.fsd.vo.ResultBean;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/business")
public class BusinessController {

  @Resource
  BusinessServiceImpl businessService;

  @Autowired
  SubStationFeignClient subStationFeignClient;
  @PostMapping("/queryStationWorkload")
  public ResultBean queryStationWorkload(@RequestBody WorkloadQuery query){
    return ResultBean.success(subStationFeignClient.queryWorkload(query));
  }

  @GetMapping("/purchaseList")
  public ResultBean getPurchaseList(){
    return ResultBean.success(businessService.getPurchaseList());
  }

}
